#ifndef __INTERRUPT_H__
#define __INTERRUPT_H__

#include "basictype.h"

enum{
    INT_EINT0=0,
    INT_EINT1,
    INT_EINT2,
    INT_EINT3,
    INT_EINT4_7,
    INT_EINT8_23, 
    INT_CAM,
    INT_nBATT_FLT,
    INT_TICK,
    INT_WDT_AC97,
    INT_TIMER0,
    INT_TIMER1,
    INT_TIMER2, 
    INT_TIMER3,
    INT_TIMER4,
    INT_UART2,
    INT_LCD,
    INT_DMA0,
    INT_DMA1,
    INT_DMA2, 
    INT_DMA3,
    INT_SDI,
    INT_SPI0,
    INT_UART1,
    INT_NFCON,
    INT_USBD,
    INT_USBH,
    INT_IIC,
    INT_UART0,
    INT_SPI1,
    INT_RTC,
    INT_ADC,
    INT_MAX_COUNT,
};

#define	EnableIrq(bit)		rINTMSK &= ~(bit)
#define	DisableIrq(bit)		rINTMSK |= (bit)
#define	EnableSubIrq(bit)	rINTSUBMSK &= ~(bit)
#define	DisableSubIrq(bit)	rINTSUBMSK |= (bit)

extern void ClearPending(UINT32 bit);
extern void ClearSubPending(UINT32 bit);

extern void interrupt_regIRQIsr(UINT32 intNum, UINT32 isrFunc);
extern void interrupt_regFIQIsr(UINT32 intNum, UINT32 isrFunc);
extern void interrupt_initISR(void);
extern void interrupt_executeIrqISR(UINT32 intNum);
extern void interrupt_executeFiqISR(UINT32 intNum);
#endif
